gl renderer: Ignore nodes with nan bounds
authorTimm Bäder <mail@baedert.org>
Tue, 26 Feb 2019 05:49:59 +0000 (06:49 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 28 Feb 2019 06:22:34 +0000 (07:22 +0100)
This can happen for certain transform nodes. The transform node's
child's bounds are fine, but the transform node bounds are all nan.
Just ignore those bounds since we can't meaningfully render them anyway.

gsk/gl/gskglrenderer.c

index 5dfd6bb6770600eeb7e1c57ad91042beb3ddb755..6684f2c0730036cc5e4497e4e79cff796f0572e5 100644 (file)
@@ -2442,7 +2442,8 @@ gsk_gl_renderer_add_render_ops (GskGLRenderer   *self,
 
   /* This can still happen, even if the render nodes are created using
    * GtkSnapshot, so let's juse be safe. */
-  if (node->bounds.size.width == 0.0f || node->bounds.size.height == 0.0f)
+  if (node->bounds.size.width == 0.0f || node->bounds.size.height == 0.0f ||
+      isnan (node->bounds.size.width) || isnan (node->bounds.size.height))
     return;
 
   /* Check whether the render node is entirely out of the current